package com.xoa.service.crm;
import com.xoa.model.crm.*;
import com.xoa.model.users.Users;
import com.xoa.util.ToJson;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * Created by qiyang on 2019/5/23.
 */
public interface CustomerService {

    /**
     *查询全部客户
     */
  //  List<Customer> potentialCustomer(Integer page, Integer pageSize, Boolean useFlag, Map map);
    /**
     *查询客户
     */
    List<CustomerWithBLOBs> potentialmeCustomer(Integer page, Integer pageSize, Boolean useFlag, Map map, String export, HttpServletResponse response);
    List<CustomerWithBLOBs> potentialCustomerSole(Integer page, Integer pageSize, Boolean useFlag, Map map, String export, HttpServletResponse response);


    List<CustomerWithBLOBs> CustomerSoles(Integer page, Integer pageSize, Map map,HttpServletResponse response);
    String powerCustomer(CustomerWithBLOBs customerWithBLOBs);
    /**
     * 添加客户
     */
    int insert(CustomerWithBLOBs customerWithBLOBs);

    /**
     * 删除用户
     */
    int deleteByPrimaryKey(Integer customerId);

    /**
     * 编辑回显数据
     */
    CustomerWithBLOBs selectByPrimaryKey(Integer customerId);

    /**
     * 编辑客户
     */
    int updateByPrimaryKeyWithBLOBs(CustomerWithBLOBs customer);


    /**
     * 添加跟进
     */
    int insertFollow(Follow follow);
    /**
     * 删除跟进
     */
    int deleteFollow(Integer followId);

    /**
     * 查询跟进
     */
    List<Follow> findAllFollow(Map map);

    /**
     * 导出
     * @param request
     * @param response
     * @return
     */
    ToJson<CustomerWithBLOBs> customerExport(HttpServletRequest request, HttpServletResponse response);

    /**
     * 导入
     * @param request
     * @param response
     * @param file
     * @return
     */
    ToJson<CustomerWithBLOBs> insertImport(HttpServletRequest request, HttpServletResponse response, MultipartFile file);

    /**
     * 添加联系人
     * @param linkman
     * @return
     */
    int insertLinkMan(Linkman linkman);


    //客户利润
    ToJson<Customer> findCustomerProfit(String month,String customerId,String enterId,String year,String day,String page,String limit ,String warehouseId,String userId);

    //员工销售业绩
    ToJson<Users> findEmployeeSales(String month,
                                    String customerId,
                                    String enterId,
                                    String year,
                                    String day,
                                    String page,
                                    String limit,
                                    String warehouseId,
                                    String userId);

    //员工提成
    ToJson<Users> findEmployeeCommission(String month, String userId,String year,String day,String flag,String price,String warehouseId,String limit,String page);
}
